<template>
  <div class="hamburger" :class="{'open-menu': sidebar['opened']}" @click="toggleClick">
    <img src="../../assets/img/menuIcon.png" alt="">
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'Hamburger',
  props: {
    isActive: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    ...mapGetters([
      'sidebar'
    ]),
  },
  methods: {
    toggleClick() {
      this.$emit('toggleClick')
    }
  }
}
</script>

<style lang="scss">

.hamburger {
  display: inline-block;
  vertical-align: middle;
  padding: 10px;
  box-sizing: border-box;
  background: #1847C6;
  box-shadow: 2px 2px 4px 0 rgba(7, 51, 172, 0.2);
  border-radius: 8px;
  overflow: hidden;
  position: absolute;
  right: -8px;
  bottom: 50px;
  cursor: pointer;
  z-index: 999999;
  img{
    display: block;
    width: 18px;
    height: 18px;
    margin: 0;
    transform: rotate(180deg);
    transition: all .6s;
  }
}
.open-menu{
  img{
    transform: rotate(0);
  }
}

.hamburger.is-active {
  transform: rotate(180deg);
}
</style>
